package com.luckyframe.project.jmeter.jmeterTestPlan.context;

import com.luckyframe.framework.config.JmeterConfig;
import com.luckyframe.project.jmeter.consumer.watch.CaseWatchTask;
import com.luckyframe.project.jmeter.execution.TestPlanStateListenter;
import com.luckyframe.project.jmeter.execution.callbacks.CaseResultDataHandler;
import com.luckyframe.project.jmeter.jmeterTestCase.domain.JmeterTestCase;
import com.luckyframe.project.jmeter.jmeterTestPlan.domain.PlanCaseTaskGroup;
import org.apache.commons.cli.avalon.CLOption;
import org.apache.jmeter.reporters.ResultCollector;
import org.apache.jmeter.reporters.Summariser;
import org.apache.jorphan.collections.HashTreeTraverser;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * hold information for a running test case
 * @author lancelot
 */
public class CaseRunningContext {

    private JmeterConfig jmeterConfig;

    private String sciptPath;

    private CLOption hostOpetion;

    private Long planId;

    private Long caseId;

    private Long recordId;

    private JmeterTestCase testCase;

    private AtomicInteger leftCaseSize;

    private TestPlanStateListenter testPlanStateListenter;

    private CaseResultDataHandler caseResultDataHandler;

    private HashTreeTraverser hashTreeTraverser;

    private Summariser summariser;

    private TestPlanListener testPlanListener;

    private ResultCollector resultCollector;

    private CaseWatchTask caseWatchTask;

    private PlanCaseTaskGroup caseTaskGroup;


    public JmeterTestCase getTestCase() {
        return testCase;
    }

    public void setTestCase(JmeterTestCase testCase) {
        this.testCase = testCase;
    }

    public PlanCaseTaskGroup getCaseTaskGroup() {
        return caseTaskGroup;
    }

    public void setCaseTaskGroup(PlanCaseTaskGroup caseTaskGroup) {
        this.caseTaskGroup = caseTaskGroup;
    }

    public CaseResultDataHandler getCaseResultDataHandler() {
        return caseResultDataHandler;
    }

    public void setCaseResultDataHandler(CaseResultDataHandler caseResultDataHandler) {
        this.caseResultDataHandler = caseResultDataHandler;
    }

    public CaseWatchTask getCaseWatchTask() {
        return caseWatchTask;
    }

    public ResultCollector getResultCollector() {
        return resultCollector;
    }

    public void setResultCollector(ResultCollector resultCollector) {
        this.resultCollector = resultCollector;
    }

    public TestPlanListener getTestPlanListener() {
        return testPlanListener;
    }

    public void setTestPlanListener(TestPlanListener testPlanListener) {
        this.testPlanListener = testPlanListener;
    }

    public Summariser getSummariser() {
        return summariser;
    }

    public void setSummariser(Summariser summariser) {
        this.summariser = summariser;
    }

    public TestPlanStateListenter getTestPlanStateListenter() {
        return testPlanStateListenter;
    }

    public void setTestPlanStateListenter(TestPlanStateListenter testPlanStateListenter) {
        this.testPlanStateListenter = testPlanStateListenter;
    }

    public AtomicInteger getLeftCaseSize() {
        return leftCaseSize;
    }

    public void setLeftCaseSize(AtomicInteger leftCaseSize) {
        this.leftCaseSize = leftCaseSize;
    }

    public HashTreeTraverser getHashTreeTraverser() {
        return hashTreeTraverser;
    }

    public void setHashTreeTraverser(HashTreeTraverser hashTreeTraverser) {
        this.hashTreeTraverser = hashTreeTraverser;
    }

    public CaseResultDataHandler getDataContentxHandler() {
        return caseResultDataHandler;
    }

    public void setDataContentxHandler(CaseResultDataHandler caseResultDataHandler) {
        this.caseResultDataHandler = caseResultDataHandler;
    }

    public String getSciptPath() {
        return sciptPath;
    }

    public void setSciptPath(String sciptPath) {
        this.sciptPath = sciptPath;
    }

    public CLOption getHostOpetion() {
        return hostOpetion;
    }

    public void setHostOpetion(CLOption hostOpetion) {
        this.hostOpetion = hostOpetion;
    }

    public JmeterConfig getJmeterConfig() {
        return jmeterConfig;
    }

    public void setJmeterConfig(JmeterConfig jmeterConfig) {
        this.jmeterConfig = jmeterConfig;
    }

    public Long getPlanId() {
        return planId;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    public Long getCaseId() {
        return caseId;
    }

    public void setCaseId(Long caseId) {
        this.caseId = caseId;
    }

    public Long getRecordId() {
        return recordId;
    }

    public void setRecordId(Long recordId) {
        this.recordId = recordId;
    }

    public void setCaseWatchTask(CaseWatchTask caseWatchTask) {
        this.caseWatchTask = caseWatchTask;
    }
}
